package com.vini.core.dao;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.vini.core.ec.Circles;

@Repository
public class CircleDaoImpl implements CircleDao {
	
	@Autowired
	private SessionFactory sessionFactory;
	private Session session;

	@Override
	public List<Circles> getCircles() {
		try{
			session = sessionFactory.openSession();
			return session.createQuery("FROM Circles").list();
		}catch (Exception e) {
			e.printStackTrace();
		}finally{
			session.close();
		}
		return null;
	}

}
